package com.wd.live.module_live.view.adapter

import android.content.Context
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.wd.live.module_base.net.bean.live.FindFansInteractListBean
import com.wd.live.module_live.R
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 * 作者: 王晶晶
 * 时间:2024/6/3
 * 描述:
 */
class FindFansInteractListAdapter(context: Context?, layoutId: Int,
                                  datas: MutableList<FindFansInteractListBean>?
) : CommonAdapter<FindFansInteractListBean>(
    context, layoutId, datas
) {
    override fun convert(holder: ViewHolder?, t: FindFansInteractListBean?, position: Int) {
        holder?.setText( R.id.name_item_id,t?.nickName)
        //头像
         holder?.getView<ImageView>(R.id.image_item_id)
            .let {
                if (it != null) {
                    Glide.with(mContext)
                        .load(t?.headPic)
                        .circleCrop()
                        .into(it)
                }

            }
        //男女
        holder?.getView<ImageView>(R.id.image_sex_item_id)
            .let {
                if (it != null) {
                    if (t?.sex==1){
                        it.setImageResource(R.mipmap.live_man)
                    }else{
                        it.setImageResource(R.mipmap.live_woman)
                    }
                }
            }
    }
}